/**
 * Created by Administrator on 2016/1/18.
 */
var buf = new Buffer("www.baidu.com");
console.log("写入字节数 : " + buf.length);

var json = buf.toJSON(buf);
console.log(json);

console.log("\n * * * * * * * * * * * 华丽丽的分割线 * * * * * * * * * * * * \n");

buf = new Buffer(26);
for (var i = 0; i < 26; i++) {
    buf[i] = i + 97;
}

console.log(buf);
console.log(buf.toString());
console.log(buf.toString("ascii"));
console.log(buf.toString("ascii", 0, 5));
console.log(buf.toString("utf-8", 0, 5));
console.log(buf.toString(undefined, 0, 5));
